package com.lxs.legou.pay.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * 支付宝配置类
 */
public class AlipayUtils {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119607484";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key="MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCF5auTH5PJLS13aPV9mRMUShBIqaJbVBFjsnee2X6+30/Exi8ytM525JU4W8tklnsx79JebzYsR17mfObfMMf4o6j/lYuwsuzmbtPiJD8IDTlhPIvCQ2HsZ2la4wCBchN37kdNf11BP+2cDk9Eh1r5DoMDAAty0620qRG8Lyt2gOUyygTsYADNPPmjhp1aKpjf7GiNMH8stKA6c8BRUqtujPs1u9orvGkdhqAY2l/EdfiZYO7YmvbRLARoX2LBgczGkNqTE7hGlbkAycoS7G2DGjGadJ55z4iXnx3FboVKTzGATaRwWzhZ0kUqc0RirC6onfvHFj3LZREZBdsu+mR7AgMBAAECggEACaMfN0alj2xGAns2eCTFX8d45pH3EpW5brCQtYk3+yr9hc8x5HdpCNuo9dZ9jC7cjRqSzKM6hfNZHEPPJi9PpVC6QDMWS9CFBozhiTxMoRq6j4oZERFige5rgdQm3CpGxnILBcPuBV1Bj+Ljx63qWVS3D0c4i7o6nW8xzJakjTHcf4g8O9I9c58DE6orls8TESwlufnsE8pgvlq8dhvNkSv7F1eS+coOUKrnzkbjbdnixtEM6kjJvSSpgWYhUkjYNjkZNxTn0Rl44nuJlnPoHnoEeu+wZWcEDkU9xqVwEAiFNrjCcUMtwJgWOyc/Km42E6FSORWY48O43sU4wnX4yQKBgQDm4onzhv+2zYP8bYr0zB2BN3MqFvKbaIvGAkOolKdiYCA9fxrsoGGrRUZBJcDoAUjz3MG+DJtsOMFWi9V7J9zm1YMNC3V1HaHel2qC0sayYaaFxubjENlI8YtRcCGDXubVVMRRbtpAXk7RnZYlTHl9Me6vvil9fArWwBuPVdjvHQKBgQCUdk8rEECUW9nXBWV5gJwo2U57ul81rY7M1DF1orZ7o5aSAdAubwXa10M4u3zNF39CrVOaxYBvhHoqaXKxCNaHqvjiaiRfmR3cQmHTRbXmazMk9qiGN/yE8DJL4MSHnqK+Od2Zcw+YGLhuHCtrFbBp1V4PZCpZ4SXEVW/Uk3XWdwKBgAN5QQ4S5+H+MZAorcCFGaSKCweFFN1Vs1SlUBNHOUV3oMSMFwGcYBvNjQMJ6F8VNd3FYnzTf7sfF3mP3QRfUyl96NzXYUsDyR2qNYYGWcrxQSoeFfcwl7RLPgdZoodxdBOdlN6MxmfVg2YP8uRYxDMn/ylRuRoUNa2JcmCzr/HZAoGANlhQhpz+ZtBwn4s0KBPyFenmFtiUPZv4p/YM3NjhH8U0OuI7CKRPalpeGwhWmOS/CvNTpVYiu6+s4JWVDEUF8sedL5RXGD9+dMA/+wyLl3sqT5+S9P7NiwQ6BRiUGGjzfdrEyYUa8jwqVvQs2Jgp6bPXKJ8r+Za3MnVr6E7KVeUCgYEAsYYSVDMY/wbFpvkW9SaE8QB9qdNujqLjsMQoyyEXHt7nLk/qm68RANp21KV4EQIx0we/uy0EiBJtw1vEpe4+zF47jJDQBamvjGQzEXP8wFOcDJ6JokVpvWaZQR5MRjldBsiPZeaga5PnHxxz0cvGVxHNzPUdgHPnznda1ZIhpJY=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhK1i9FWYTljFXOdpKI3fHf33YS8cm21HHZuVVBzBNc6k9ZOI+qf9LRS/hJKYqjjnjZSVbSwZD7ymVfQGg6PuQ7kfY/WIcEHLeMtxMFCMVuu5KWYbUx7rHnmet3gXmI3/UlRd2anpblth48JUtB4W9owMTQysMomufAgoA87IpQzYMpokbeXSPj9HHvqoOZKBQcovgfvbPRC5bl6fd/VGy67AW4h5x0Fw8KmSOxz2OurW36z4eghPwOBQUCTrMQ716Cy2TYhHnDASx6esot87lxTkzWudn2fV+j1qlmDc9Yl1wHkCv3n8wquuAE8UgiD0tF6RVc6AcJ/E3p1L4ngI+wIDAQAB";

    // 服务器异步通知页面路径
    //需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://34dtab.natappfree.cc/getnotify";

    // 页面跳转同步通知页面路径
    //需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://34dtab.natappfree.cc/getreturn";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关,注意这些使用的是沙箱的支付宝网关，与正常网关的区别是多了dev
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


    //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
